package mulMan;

import java.util.List;

import mulMan.domain.ListOfPlaylists;
import mulMan.domain.Playlist;
import mulMan.gui.controller.PlaylistsController;
import mulMan.gui.view.PlaylistsFullView;
import mulMan.services.PlaylistServices;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		
		ApplicationContext context = new ClassPathXmlApplicationContext(
				"application-context.xml");
		PlaylistServices playlistServices = (PlaylistServices) context.getBean("playlistServices");
		
		List<Playlist> playlists = playlistServices.getPlaylists();
		ListOfPlaylists listOfPlaylists = (ListOfPlaylists) context.getBean("listOfPlaylists");
		listOfPlaylists.addAll(playlists);
		
		PlaylistsFullView view = new PlaylistsFullView(listOfPlaylists);
		PlaylistsController plC = (PlaylistsController) context.getBean("playlistsController", listOfPlaylists, view);
		
		plC.addAudioFilesView();
	}
}
